<?php
/*******************************************************************************
 * $Date:: 25 May 2010 10:54:58												   $
 * $Revision::																   $
 * $Author:: Tuan Duong													   	   $
 * $Comment::															   	   $
 ******************************************************************************/

class Bet_Log extends Zend_Log 
{
    /**
     * @var Bet_Log
     */    
    static protected $instance = null;

    /**
     * Config
     * @var array
     */
    static protected $configs;
    
    public function __construct() {
        parent::__construct();
        if (!isset(self::$configs) || !is_array(self::$configs)) {
            $configs = new Zend_Config_Ini(CONFIG_FILE);
            $configsArray = $configs->toArray();
            self::$configs = $configsArray[APPLICATION_ENV];
            // Load config manually
        }
    }
    
    /**
     * @return Bet_Log 
     */
    public static function getLog($type = "bet") {
        switch ($type) {
        	default:
        	   return Bet_Log_Error::getInstance();
        	break;
        }            
    }

    /**
     * Set configuration
     * @param array $configs
     */
    public static function setConfigs($configs) {
        self::$configs = $configs;
    } 
}
 
